From 856279da34c7a1773bde71c723306b5beaaf6d14 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 13 Jan 2009 15:24:03 +0000 Subject: [PATCH] =?utf8?q?Bug=20566532=20=E2=80=93=20GtkScaleButton=20impl?= =?utf8?q?ementation=20of=20GtkOrientable?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 2009-01-13 Christian Dywan Bug 566532 – GtkScaleButton implementation of GtkOrientable * gtk/gtk.symbols: * gtk/gtkscalebutton.c (gtk_scale_button_class_init), (gtk_scale_button_set_property): * gtk/gtkscalebutton.h: Deprecate gtk_scale_button_get_orientation in favour of implementing GtkOrientable. Patch by Bruce Cowan. svn path=/trunk/; revision=22112 --- ChangeLog | 10 ++++++++++ gtk/gtk.symbols | 2 ++ gtk/gtkscalebutton.c | 24 +++++++++++++----------- gtk/gtkscalebutton.h | 11 ++++++++--- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f49b9ddd1..560992980e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-13 Christian Dywan + + Bug 566532 – GtkScaleButton implementation of GtkOrientable + + * gtk/gtk.symbols: + * gtk/gtkscalebutton.c (gtk_scale_button_class_init), + (gtk_scale_button_set_property): + * gtk/gtkscalebutton.h: Deprecate gtk_scale_button_get_orientation + in favour of implementing GtkOrientable. Patch by Bruce Cowan. + 2009-01-13 Tor Lillqvist Bug 164002 - query scripts don't work uninstalled on windows diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 79b6b363a4..029b6136e5 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -3469,8 +3469,10 @@ gtk_scale_button_set_icons gtk_scale_button_set_value gtk_scale_button_get_adjustment gtk_scale_button_set_adjustment +#ifndef GTK_DISABLE_DEPRECATED gtk_scale_button_get_orientation gtk_scale_button_set_orientation +#endif gtk_scale_button_get_plus_button gtk_scale_button_get_minus_button gtk_scale_button_get_popup diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index b6933bc23c..32a70e1984 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -51,6 +51,7 @@ #include "gtkhscale.h" #include "gtkvscale.h" #include "gtkframe.h" +#include "gtkorientable.h" #include "gtkhbox.h" #include "gtkvbox.h" #include "gtkwindow.h" @@ -156,9 +157,11 @@ static void gtk_scale_button_scale_value_changed(GtkRange *range); /* see below for scale definitions */ static GtkWidget *gtk_scale_button_scale_box_new(GtkScaleButton *button); -static guint signals[LAST_SIGNAL] = { 0, }; +G_DEFINE_TYPE_WITH_CODE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON, + G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, + NULL)) -G_DEFINE_TYPE (GtkScaleButton, gtk_scale_button, GTK_TYPE_BUTTON) +static guint signals[LAST_SIGNAL] = { 0, }; static void gtk_scale_button_class_init (GtkScaleButtonClass *klass) @@ -187,14 +190,9 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass) * * Since: 2.14 **/ - g_object_class_install_property (gobject_class, - PROP_ORIENTATION, - g_param_spec_enum ("orientation", - P_("Orientation"), - P_("The orientation of the scale"), - GTK_TYPE_ORIENTATION, - GTK_ORIENTATION_VERTICAL, - GTK_PARAM_READWRITE)); + g_object_class_override_property (gobject_class, + PROP_ORIENTATION, + "orientation"); g_object_class_install_property (gobject_class, PROP_VALUE, @@ -426,7 +424,7 @@ gtk_scale_button_set_property (GObject *object, switch (prop_id) { case PROP_ORIENTATION: - gtk_scale_button_set_orientation (button, g_value_get_enum (value)); + gtk_orientable_set_orientation (GTK_ORIENTABLE (button), g_value_get_enum (value)); break; case PROP_VALUE: gtk_scale_button_set_value (button, g_value_get_double (value)); @@ -705,6 +703,8 @@ gtk_scale_button_set_adjustment (GtkScaleButton *button, * Returns: the #GtkScaleButton's orientation. * * Since: 2.14 + * + * Deprecated: 2.16: Use gtk_orientable_get_orientation() instead. **/ GtkOrientation gtk_scale_button_get_orientation (GtkScaleButton *button) @@ -722,6 +722,8 @@ gtk_scale_button_get_orientation (GtkScaleButton *button) * Sets the orientation of the #GtkScaleButton's popup window. * * Since: 2.14 + * + * Deprecated: 2.16: Use gtk_orientable_set_orientation() instead. **/ void gtk_scale_button_set_orientation (GtkScaleButton *button, diff --git a/gtk/gtkscalebutton.h b/gtk/gtkscalebutton.h index ec6baf0402..61239098db 100644 --- a/gtk/gtkscalebutton.h +++ b/gtk/gtkscalebutton.h @@ -95,13 +95,18 @@ void gtk_scale_button_set_value (GtkScaleButton *button, GtkAdjustment * gtk_scale_button_get_adjustment (GtkScaleButton *button); void gtk_scale_button_set_adjustment (GtkScaleButton *button, GtkAdjustment *adjustment); -GtkOrientation gtk_scale_button_get_orientation (GtkScaleButton *button); -void gtk_scale_button_set_orientation (GtkScaleButton *button, - GtkOrientation orientation); GtkWidget * gtk_scale_button_get_plus_button (GtkScaleButton *button); GtkWidget * gtk_scale_button_get_minus_button (GtkScaleButton *button); GtkWidget * gtk_scale_button_get_popup (GtkScaleButton *button); +#ifndef GTK_DISABLE_DEPRECATED + +GtkOrientation gtk_scale_button_get_orientation (GtkScaleButton *button); +void gtk_scale_button_set_orientation (GtkScaleButton *button, + GtkOrientation orientation); + +#endif /* GTK_DISABLE_DEPRECATED */ + G_END_DECLS #endif /* __GTK_SCALE_BUTTON_H__ */ -- 2.30.2